// 统一管理项目角色相关的接口

import request from "@/utils/request";

import type { addRoleResponseData, getRoleListResponseData, roleInfoData,} from './type'
// @ts-ignore
enum API{
    ROLE_LIST_URL = "/manage/role/list",
    ADD_ROLE_URL = "/manage/role/add",
    UPDATE_ROLE_URL = "/manage/role/update"
}

// 获取角色列表
export const reqRoleList = () => request.get<any,getRoleListResponseData>(API.ROLE_LIST_URL)
export const reqAddRole = (data:roleInfoData)=>request.post<any,addRoleResponseData>(API.ADD_ROLE_URL,data)
export const reqUpdateRole = (data:roleInfoData)=>request.post<any,addRoleResponseData>(API.UPDATE_ROLE_URL,data)